package com.zhongkai.service.impl;

import com.mysql.jdbc.StringUtils;
import com.zhongkai.app.service.GmsImService;
import com.zhongkai.app.service.IBaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 聊天服务
 * */
@Service
@Transactional(rollbackFor = Exception.class)
public class GmsImServiceImpl implements GmsImService {

    @Autowired
    private IBaseDao iBaseDao;

    /**
     * 维修端 聊天服务器正式连接 (我在线上)
     *
     * @param uuid 维修用户uuid
     * @param uuid 维修用户ip
     * */
    @Override
    public void mmwenku(String uuid, String ip) {
        if (StringUtils.isNullOrEmpty(uuid) || StringUtils.isNullOrEmpty(ip)) {
            return;
        }
        //mainState 0 离线 1在线
        //Maintain
        iBaseDao.update1("update Maintain unit set unit.mainState=1 , unit.mainIp='"+ip+"' where unit.tainUuid='"+uuid+"'");

        return ;
    }
}
